const path = require('path');

function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  lintOnSave: false,
  publicPath: './', //根路径
  outputDir: 'dist', //构建输出目录
  assetsDir: 'assets', // 静态资源目录(js,css,img,fonts)
  devServer: {
    open: true,
    host: 'localhost',
    port: '8000',
    https: false, //是否使用https协议
    hotOnly: false, //是否开启热更新
    proxy: {
      '/api': {
        target: 'http://localhost:8000',
        pathRewrite: {
          '^/api': '/mock'
        }
        
      }
    }
  },

  chainWebpack: (config) => {
    //修改文件引入自定义路径
    config.resolve.alias
      .set('@', resolve('./src'))
      .set('style', resolve('./src/assets/styles'))
      .set('common',resolve('./src/common'))
  }
}